package com.yiyi.credit.manage.sso.manager.common.handler;


import com.yiyi.credit.manage.sso.model.dto.CookieInfoDto;
import com.yiyi.credit.manage.sso.model.dto.response.SpApiResponse;
import com.yiyi.credit.manage.sso.model.entity.SysUser;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;


@FeignClient(value = "yiyi-credit-manage-sso-api")
@RequestMapping(value = "userapi/system/user")
public interface UserManagerClient {

    @RequestMapping(value = "/getTokenKey", method = RequestMethod.POST)
    SpApiResponse<Map<String, String>> getTokenKey() throws Exception;

    @RequestMapping(value = "/authToken", method = RequestMethod.POST)
    SpApiResponse authToken(@RequestParam("token") String tokenVal) throws Exception;

    @RequestMapping(value = "/loginSysUser", method = RequestMethod.POST)
    SpApiResponse<CookieInfoDto> loginSysUser(@RequestParam("userName") String userName,
                                              @RequestParam("password") String password) throws Exception;

    @RequestMapping(value = "/logout", method = RequestMethod.POST)
    SpApiResponse logout(@RequestParam("tokenVal") String tokenVal) throws Exception;

    @RequestMapping(value = "/getSysUserByToken", method = RequestMethod.POST)
    SpApiResponse<SysUser> getSysUserByToken(@RequestParam("token") String token) throws Exception;
}
